package com.yanqu.road.entity.activity.suitang.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.sql.Types;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_u_activity_suitang_data")
public class SuiTangUserData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "玩家ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "膜拜时间")
    private long worshipTime;

    @FieldTypeAnnotation(desc = "巅峰膜拜时间")
    private long worshipEndPeriodTime;

    @FieldTypeAnnotation(desc = "职位ID")
    private int positionId;

    @FieldTypeAnnotation(desc = "战功")
    private long zhanGong;

    @FieldTypeAnnotation(desc = "商会")
    private String unionId = "";

    @FieldTypeAnnotation(desc = "元宝加速次数")
    private long moveSpeedUpNum;

    @FieldTypeAnnotation(desc = "服装兑换信息", sqlType = Types.LONGVARCHAR)
    private Map<Integer, Integer> skinExchangeMap = new ConcurrentHashMap<>();

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public String getUnionId() {
        return unionId;
    }
    public void setUnionId(String unionId) {
        if (unionId == null){
            return;
        }
        if (this.unionId == null || !this.unionId.equals(unionId)) {
            this.unionId = unionId;
            setOp(DataStatus.Update);
        }
    }

    public long getWorshipTime() {
        return worshipTime;
    }

    public void setWorshipTime(long worshipTime) {
        if (this.worshipTime != worshipTime) {
            this.worshipTime = worshipTime;
            setOp(DataStatus.Update);
        }
    }

    public long getWorshipEndPeriodTime() {
        return worshipEndPeriodTime;
    }
    public void setWorshipEndPeriodTime(long worshipEndPeriodTime) {
        if (this.worshipEndPeriodTime != worshipEndPeriodTime) {
            this.worshipEndPeriodTime = worshipEndPeriodTime;
            setOp(DataStatus.Update);
        }
    }

    public int getPositionId() {
        return positionId;
    }

    public void setPositionId(int positionId) {
        if (this.positionId != positionId) {
            this.positionId = positionId;
            setOp(DataStatus.Update);
        }
    }

    public long getZhanGong() {
        return zhanGong;
    }

    public void setZhanGong(long zhanGong) {
        if (this.zhanGong != zhanGong) {
            this.zhanGong = zhanGong;
            setOp(DataStatus.Update);
        }
    }

    public long getMoveSpeedUpNum() {
        return moveSpeedUpNum;
    }

    public void setMoveSpeedUpNum(long moveSpeedUpNum) {
        if (this.moveSpeedUpNum != moveSpeedUpNum) {
            this.moveSpeedUpNum = moveSpeedUpNum;
            setOp(DataStatus.Update);
        }
    }

    public Map<Integer, Integer> getSkinExchangeMap() {
        return skinExchangeMap;
    }

    public void setSkinExchangeMap(Map<Integer, Integer> skinExchangeMap) {
        this.skinExchangeMap = skinExchangeMap;
        setOp(DataStatus.Update);
    }
}
